package com.wnxy.sddfp.trade;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@MapperScan("com.wnxy.sddfp.trade.mapper")
@ComponentScan({"com.wnxy.sddfp.trade","com.wnxy.sddfp.common"})
@EnableFeignClients({
        "com.wnxy.sddfp.client.system",
        "com.wnxy.sddfp.client.bank",
        "com.wnxy.sddfp.client.payback"
})
public class TradeCenterApplication {
    public static void main(String[] args) {
        SpringApplication.run(TradeCenterApplication.class);
    }

    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
        return interceptor;
    }
}
